[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
execute(s) execute string
execute(s,se) execute string
execute(s,se,rf) execute string
Execute string s as an QTAwk statement or expression. The parameter se
determines whether s is executed as a string or expression. For se
FALSE (default value for first form), s is assumed to be an QTAwk
statement and executed as such. For se TRUE, s is assumed to an
expression and executed as such. the rf parameter determines the error
recovery of QTAwk. For rf == FALSE (default value for first two
forms), any error in parsing or executing s, halts QTAwk execution.
For rf == TRUE, QTAwk halts parsing or execution of s only.
If the current input record is:
new_str = "The new value of any variable";
then:
print execute($0);
or
print execute($0,0);
will both set the variable 'new_str' to the string value:
"The new value of any variable"
and output the value one, 1.
print execute($0,1);
will also set the variable 'new_str', but will output:
"The new value of any variable"
The input record:
{ w_page = 85; l_page = 88; top_m = 5; bottom_m = 5; }
will set the four variables to the values:
w_page = 85;
l_page = 88;
top_m = 5;
bottom_m = 5;
when the following is executed:
execute($0);
or
execute($0,0);
execute(a) execute array
execute(a,se) execute array
execute(a,se,rf) execute array
The last example above could also be executed using the array form of
the execute statement. The se and rf parameters are as for string
execution above. With the array:
set_val[1] = "{";
set_val[2] = "w_page = 85;";
set_val[3] = "l_page = 88;";
set_val[4] = "top_m = 5;";
set_val[5] = "bottom_m = 5;";
set_val[6] = "}";
Then:
execute(set_val);
or
execute(set_val,0);
will execute the array as a single statement and set the variables as
indicated. The array could have been executed as an expression:
set_val[1] = "w_page = 85,";
set_val[2] = "l_page = 88,";
set_val[3] = "top_m = 5,";
set_val[4] = "bottom_m = 5;";
then
execute(set_val,1);
will set the variables as indicated and return a value of five, 5.
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson